/**
 * ------------------------------------------------------------*
 *          COPYRIGHT (C) 2006 BOCO Inter-Telecom INC          *
 *   CONFIDENTIAL AND PROPRIETARY. ALL RIGHTS RESERVED.        *
 *                                                             *
 *  This work contains confidential business information       *
 *  and intellectual property of BOCO  Inc, Beijing, CN.       *
 *  All rights reserved.                                       *
 * ------------------------------------------------------------*
 *
 *
 */
/**
 *Revision Information:
 *
 *@version 1.0 2006-3-15 release(zhanglei)
 */
package com.boco.webmaster.base;

import com.boco.common.util.spring.SpringBeanHome;

public class ModelFactory {
    private static ModelFactory instance;
    private SpringBeanHome modelHome;
    private ModelFactory() {
    }

    public static ModelFactory getInstance(){
        return instance;
    }

    public static ModelFactory createInstance(String[] springXmlNames){
        ModelFactory _instance = new ModelFactory();
        _instance.modelHome = new SpringBeanHome(springXmlNames);
        instance = _instance;
        return instance;
    }

    public IModel getModel(String modelName){
        return (IModel)this.modelHome.getBean(modelName);
    }
}
